package com.ck.shardinggo.controller.core;

import com.ck.shardinggo.bo.RestResponseBo;
import com.ck.shardinggo.controller.support.BaseController;
import com.ck.shardinggo.enums.ResultEnum;
import com.ck.shardinggo.service.PowerPerformanceService;
import com.ck.shardinggo.service.PowerperformanceHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author yd
 * @Date 2018/12/21 16:12
 */
@Api(value = "/powerperformancehistory", tags = "动环历史性能")
@Slf4j
@RestController
@RequestMapping("/powerperformancehistory")
public class PowerPerformanceHistoryController extends BaseController {

    @Autowired
    private PowerperformanceHistoryService powerperformanceHistoryService;


    @GetMapping("/batchsave/{num}")
    @ApiOperation(value = "批量插入",notes = "自定义插入数量")
    public RestResponseBo batchsave(@RequestParam(required = true) @ApiParam(value = "num",required = true) Integer num){
        powerperformanceHistoryService.bacthSave(num);
        return RestResponseBo.ok(ResultEnum.LOGIN_SUCCESS.getMessage(),ResultEnum.LOGIN_SUCCESS.getCode());
    }

    /*@GetMapping("getByDeviceId/{id}")
    @ApiOperation(value = "通过设备ID查询最近10条记录",notes = "通过设备ID查询")
    pub*/



}
